select via API REST variable

1
0
-1

How to mount a select via API REST variable with a JSON type variable in UI Designer? I need this so I do not have to be returning to the studio to be able to select.

2 answers

1
+1
-1
This one is the BEST answer!

1) make sure you have your BDM ready with values
2) in your form add a variable selectValues type API with the value

../API/bdm/businessData/com.company.model.{{ yourBDM }}?q=find&p=0&c=100

3) in your form add a variable type selectedValue type JSON
4) in your form add a Select widget
5) change Displayed Key to a field from the BDM
6) change Available Values from Fx to x and enter selectValues
7) change Value to selectedValue

for debug purposes

1) Add a Text Widget
2) for Text add the following

Selected customer {{ selectedCustomer | json }}

Providing everything is correct click preview
change your Select and you should see the text box change...

regards
Seán

PS: As this reply answers your question, please mark as resolved.

Comments

Submitted by romualdo.s.rs on Fri, 05/05/2017 - 13:17

Thanks for the feedback. I believe that I expressed myself badly, I have a BDM where the information of the Clients are, where it is, for example, the code and the name of the client, and I have a BDM where are the information of the users of each client company ours, According to the client selected in the UI Designer display i can in another screen of the UI Designer show only the users of that selected company? Preferably without having to create a new task for this to make the process faster?

Submitted by Sean McP on Sun, 05/07/2017 - 02:51

Yeah, completely didn't express the question correctly...2 BDMs? :)

Anyway easy enough to complete using the example above

Add a new Variable called Users type API with value...

../API/bdm/businessData/com.company.model..{{ yourBDM 2 }}?q=findByClient&p=0&c=10&f=Company={{selectedValue.Client}}

Add a table to your page and add Headers and Column Keys (these are the names of the BDM fields you want to display should be the same number as Headers).

then change Content from Fx to x and enter Users

save and test, when you change the Client select list you should now see the table of Users change...

It works here so it should also for you, assuming you put the right columns/names etc. in to the system

regards
Seán

PS: As this reply answers your question, please mark as resolved.

Submitted by romualdo.s.rs on Mon, 05/08/2017 - 13:06

Perfect, that's what I needed right now, Thanks for the help.

1
0
-1

Do you have any idea how I can solve the need of my question? I thank you very much, I lock it for a while too and I have no idea where to start:
http://community.bonitasoft.com/questions-and-answers/add-multiple-row-u...

Comments

Submitted by Sean McP on Mon, 05/08/2017 - 21:33

Please DO NOT refer to another question in this way - This question is answered and I don't want to come back to it.

IF I read the other question, and IF I have time to answer it, and IF I know the answer I will repond but not like this.

This is what we call bad Netiquette.

regards

Submitted by romualdo.s.rs on Mon, 05/08/2017 - 21:41

Sorry, I did not know this was something seen as something wrong on the forum, thanks for all the help so far

Notifications