cancel
Showing results for 
Search instead for 
Did you mean: 

How to Pass the Collection Name Dynamically

salman_shaik
Level 6

Hi,
I have a collection( Column Names) it contains three fields Collection Name, Old Field Name, New field name it contains some initial values, running a loop over this collection and inside the loop i am using  Rename Field action under collection manipulation vbo to change the field name of  a specific collection.


My target is to change the column names of the collections dynamically and store in the same collection. I have to change 25-30 collection column names so i want to iterate it through loop.

But the problem is in the input we have to provide the collection but i am providing the collection name which is coming from Column Names collection, BP is treating it as text is there any work around  to tell BP first look for any collection is present with the name provided else throw an error.

I tried with adding [] in the collection name, but its not working. same issue with output as well because its expecting the collection but i am passing the collection name dynamically. 

21369.png

21370.png

21371.png

21372.png



------------------------------
If I was of assistance, please vote for it to be the "Best Answer".

Thanks & Regards,
Salman Shaik
------------------------------
If I was of assistance, please vote for it to be the "Best Answer". Thanks & Regards, Salman Shaik
6 REPLIES 6

Predefine your i/p and o/p collection stage without any data and use it during workflow.



------------------------------
If I was of assistance, please vote for it to be the "Best Answer".

Thanks & Regards,
Tejaskumar Darji - https://www.linkedin.com/in/tejaskumardarji/
Technical Lead
------------------------------

Hi Tejaskumar,
From an API i am getting JSON response, after parsing the json its creating 20 collections with prefilled columns i want to change the column names inside the collections, each collection column name would be different to each collection. so i have taken another collection which contains all the collection names(which are created by parsing the json) and iterating the collection.

BP is considering the collection name as text not the collection since the value is being populated from the collection.
Do we have anyway to differentiate the collection name with text?



------------------------------
If I was of assistance, please vote for it to be the "Best Answer".

Thanks & Regards,
Salman Shaik
------------------------------
If I was of assistance, please vote for it to be the "Best Answer". Thanks & Regards, Salman Shaik

Hi I don't think there is any way and this is not an issue from BP but that is how it works.

You can redesign your logic to use the predefined collection names instead of going with dynamic names.



------------------------------
If I was of assistance, please vote for it to be the "Best Answer".

Thanks & Regards,
Tejaskumar Darji - https://www.linkedin.com/in/tejaskumardarji/
Technical Lead
------------------------------

Hi,

just very quick and raw thought and I did not think it through so it could be complete nonsense - could you add your collections to one big collection (create a nested collection) and then loop through those nested collection and work through it - copying it into target renamed collection?

Regards

Zdenek 



------------------------------
Zdeněk Kabátek
Head of Professional Services
NEOOPS
http://www.neoops.com/
Europe/Prague
------------------------------

Hi,

As a work around i previously implemented the same, but due to the collection count is more i have to add so many actions so i am checking in the community is there any shorter way to solve it? But i got know no other way is available.



------------------------------
If I was of assistance, please vote for it to be the "Best Answer".

Thanks & Regards,
Salman Shaik
------------------------------
If I was of assistance, please vote for it to be the "Best Answer". Thanks & Regards, Salman Shaik

Hi @SalmanShaik

Can you provide some screenshots of the collections you are retrieving from the json? I have a few processes which extract information as collection into a single collection and for these it created columns for the name of the collection and a second column which contains an embedded collection. I'm assuming you are working in a similar way?(see screenshot below). If thats the case then you would need to loop through the main collection and either pass the embedded collection to a new collection or use Read Collection Names action for the embedded collection. In the screen example I provided you column I need is Table so I would use the Elements.Table to pass the collection to a new collection or Read field names to get the collection names. Hopefully my explanation is clear.

21364.png



------------------------------
Michael ONeil
Technical Lead developer
NTTData
Europe/London
------------------------------