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

Get the mashup button-ID from inside the called service

SOLVED
Highlighted
Amethyst

Get the mashup button-ID from inside the called service

Is it possible to get the button-ID (and related properties) who started a service from a mashup ?

 

what I would make easier is this:

I have a service who makes a data-preview, or a data-import . This service is called from a mashup button.

A boolean variable can be set as service parameter to switch between the two functions.

 

I would have instead 2 buttons on the mashup, one that makes preview, another that makes import.

Is it possible to get button ID from inside the service ? If so, I can switch from preview and import without need to deal with a BOOL to set/reset from the mashup

 

I know I could do by duplicating the service .. and use one button for each one ... but make mashup mode complex ..

1 ACCEPTED SOLUTION

Accepted Solutions

Re: Get the mashup button-ID from inside the called service

One of the ways to achieve your scenario is by using toggle buttons instead of regular buttons on the Mashup. Please follow the below steps to achieve your use case.

  1. Place two toggle buttons on the Mashup ( one for Preview and the other for Import)
  2. Create an Expression function that accepts two Boolean inputs and returns a Text output. (Expressions can be added from the bottom right corner of the Mashup)
  3. Bind the state of the toggle switches to the input parameters of the expression. Evaluate the expression with state changed event of the toggle switches.
  4. Code the Expression as below:
if(Inp1){
    Output = "Preview";
}
else if(Inp2){
    Output = "Import";
}
else{
    Output = "No action";
}

Now bind the output of this expression to the service that does your implementation. Please make sure it accepts String as an input parameter and write the condition accordingly. Please let me know if you run into any issues with the implementation.

View solution in original post

3 REPLIES 3
Highlighted

Re: Get the mashup button-ID from inside the called service

Hi.

 

Check out this thread. Does it help in any way?

Re: Get the mashup button-ID from inside the called service

One of the ways to achieve your scenario is by using toggle buttons instead of regular buttons on the Mashup. Please follow the below steps to achieve your use case.

  1. Place two toggle buttons on the Mashup ( one for Preview and the other for Import)
  2. Create an Expression function that accepts two Boolean inputs and returns a Text output. (Expressions can be added from the bottom right corner of the Mashup)
  3. Bind the state of the toggle switches to the input parameters of the expression. Evaluate the expression with state changed event of the toggle switches.
  4. Code the Expression as below:
if(Inp1){
    Output = "Preview";
}
else if(Inp2){
    Output = "Import";
}
else{
    Output = "No action";
}

Now bind the output of this expression to the service that does your implementation. Please make sure it accepts String as an input parameter and write the condition accordingly. Please let me know if you run into any issues with the implementation.

View solution in original post

Highlighted

Re: Get the mashup button-ID from inside the called service

Hi @iguerra.

 

If one of the previous responses answered your question, please mark the appropriate response as the Accepted Solution for the benefit of others with the same question.

 

Regards.

 

--Sharon

Announcements

Thingworx Navigate content has a new home! Click here to access the new Thingworx Navigate forum! ______________________________