Skip to main content
1-Visitor
January 17, 2019
Solved

Loading Database Thing Dynamically in the Mashup

  • January 17, 2019
  • 5 replies
  • 2736 views

Hi All,

I am new to ThingWorx Composer. I need to load the database thing dynamically into the mashup based on the user organization permission.

For example:

I have two things name called Factory1 and Factory2.

Factory1 and Factory2 have the same services and properties but different database configuration.

If User1 Login, the application needs to load the Factory1 Thing in the Mashup.

if User2 Login, the application needs to load the Factory2 Thing in the same Mashup.

 

Please suggest me on the same.

 

Best answer by zyuan1

According to your request, build a infotable with column User and DatabaseName, use GetCurrentUser service (CurrentSessionInfo Resources) to get the user name, and bind the related name to previous mentioned dynamic service.

5 replies

5-Regular Member
January 21, 2019

1. Add new service to a Thing

2. Enable "Dynamic", for entities choose "DataTable" Thing Template

3. Type in the services you want in the script field, Complete

4. The new service will have an input for entity name.

zyuan15-Regular MemberAnswer
5-Regular Member
January 21, 2019

According to your request, build a infotable with column User and DatabaseName, use GetCurrentUser service (CurrentSessionInfo Resources) to get the user name, and bind the related name to previous mentioned dynamic service.

Support
February 1, 2019

Hi @snoor.

 

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

 

Regards.

 

--Sharon