How to convert code and id in forms bonita?
I need to convert the id and code to name. I save the id and code in my main table instead of the name. But when I display the content of table it shows the id and code. I have tables that handle the equivalent of the code and id. How can i convert it in my UI Designer. Please help. Thanks
What I'd and code? Makes no sense...
Did you mean you want to retrieve name of an User based on Id ?
Yes. Thanks for the Explanation . Here is what i understood.
Scenario 1 - You have the Information (both 001 - All Company) in a table. Which you display to the User.
But you save only the code in another table . Now you want to bring the name from Table 1 and Code from Table 2 .
Scenario 2 - setup table is the Final Table from which you are displaying the code that you had earlier saved. If you want to display the name as well, could try saving both the values (code and name) as well in the same table.
This way it will be easier for you.
Scenario 3 - in the first table where you mentioned that you have (001 and All company), you only want to Display the name but on selection, only the code gets saved in the background.
Hence user just sees the name and selects one but in the background only the code is saved.
Perhaps you could do a detailed scenario
Here is how I did it.
1) Inside the Page or Form , create a page variable of type string.Keep the Variable empty . In the Page where you are displaying the code, that you are fetching from the main table. You must be displaying all the Available codes in a drop down .(you could use check box as well)
User has to select a particular value from the available values in the Drop down.
2) collect the selected value and save the value inside the page variable (string) that you had declared earlier.
To do that you need to use the formInput.variableName in the value section for the dropdown.
3) Now Fire an API call to the Lookup table using the page variable value. Bonita provides inbuilt API's to query the database. To get a list of available API to use
go to Bonita Studio => Development =>Business Data Model =>Manage => select the Table
that you want to Query => Navigate to Queries => it will show all available Queries.
Below is the Sample of my Query -
As you can see that status is the value that I collect separately and pass it to the API query as a parameter.