cancel
Showing results for 
Search instead for 
Did you mean: 
cancel
Showing results for 
Search instead for 
Did you mean: 

Community Tip - Did you get called away in the middle of writing a post? Don't worry you can find your unfinished post later in the Drafts section of your profile page. X

Thingworx 8.5 bind infotable mashup parameter to expression

TomV
7-Bedrock

Thingworx 8.5 bind infotable mashup parameter to expression

We have a parent mashup with a collection passing an infotable to the child mashup and would like to use a column from the infotable as input for an expression.

 

When I click the bindings icon in properties on the mashup and select binding target, I don't see the expression and it's parameters. (If I click binding sources I can select the output of the expression).

 

Am I missing something or has this been removed in 8.5?

1 ACCEPTED SOLUTION

Accepted Solutions
bmihaiciuc
11-Garnet
(To:TomV)

It looks like the UI for this has been strangely removed from 8.5, however the underlying functionality is still there. There a few ways to go around this limitation:

 

  1. Use an intermediary widget (e.g. a text field) and bind from the infotable to the text field and then from the text field to your expression.
  2. Export your mashup to XML. It will contain a big CDATA section with a JSON object holding the mashup definition, including the bindings. You can manually add that binding in that JSON and import back.
  3. Export to an older version of Thingworx and create this binding there.

View solution in original post

7 REPLIES 7
raluca_edu
17-Peridot
(To:TomV)

Hi,

 

What version of 8.5 you are using?

I remember in 8.5.0, this was a defect.

 

Also, are you using navigation widget?

 

Thank you,

Raluca Edu

TomV
7-Bedrock
(To:raluca_edu)

Hi,

Thanks for your reply, we are using 8.5.1-b90.

There is no navigation widget involved, it's passed through via the collection parameter mapping.

Thanks

slangley
23-Emerald II
(To:TomV)

Hi @TomV.

 

From testing under 8.5.3, it does not appear that you can bind an infotable with an expression.  If you can provide details of your use case, we might be able to make a suggestion for another approach.

 

Regards.

 

--Sharon

TomV
7-Bedrock
(To:slangley)

Hi Sharon,

 

The use case is basically a mashup with a collection, and mashups inside that collection with new collections. This involves a service in the top level mashup which returns nested infotables being passed down into the collections. This means some mashups meant to be used in collections have infotables as a mashup parameter.

 

In one of the mashups I wanted to show/hide something based on the value of a field in one of the infotable parameters, so I created an expression and wanted to pass the field into that expression.

 

This is a bit of a special situation of course since it relies on the fact that the infotable from which I want to get the field only contains a single row (which it does, because it's a parameter to the service returning the nested structure and it's the selected row from a dropdown). The solution is of course to add the field to the data shape of a higher-level infotable in the nesting structure, adding the value in the service, adding an extra parameter to the mashup and using that.In my use case those are just a bunch of unneeded columns in a datashape and parameters in a mashup.

So:

- user selects row in dropdown

- selected row passed to service

- service returns infotable "resultinfotable", with a column ("selectedrow") of type infotable

- selected row is assigned to selectedrow column.

- infotable is passed to collection, mapping "selectedrow" to a mashup parameter.

- nested mashup needs selectedrow.keyfield in an expression.

 

I can get to the product.productid from pretty much everywhere I need to, except expressions, and have to add selectedrowkeyfield to the resultinfotable and mashup parameters only to make the expression work.

 

I think that worked in previous versions and I just wondered why I could bind the column to a bunch of things, but not to an expression (and as it turns out not to another mashup parameter either).

 

 

slangley
23-Emerald II
(To:TomV)

Hi TomV.

 

The short answer is that if the data shape is defined for it, you can access the individual fields.  However, this sounds like a very complex configuration that would best be answered by our services group.  To engage with them, please contact the Sales team.

 

Regards.

 

--Sharon

bmihaiciuc
11-Garnet
(To:TomV)

It looks like the UI for this has been strangely removed from 8.5, however the underlying functionality is still there. There a few ways to go around this limitation:

 

  1. Use an intermediary widget (e.g. a text field) and bind from the infotable to the text field and then from the text field to your expression.
  2. Export your mashup to XML. It will contain a big CDATA section with a JSON object holding the mashup definition, including the bindings. You can manually add that binding in that JSON and import back.
  3. Export to an older version of Thingworx and create this binding there.
TomV
7-Bedrock
(To:bmihaiciuc)

Hi, Thanks for your answer. I'll accept yours since you actually answered my question if that UI is missing or if I just couldn't find it.

For now I solved it by adding a field in the master infotable and that works, but it looks as if your 3 suggestions would work too.

Top Tags