cancel
Showing results for 
Search instead for 
Did you mean: 

How to change the column name in a Blue Prism Collection?

I am working with SQL Queries for a Blue Prism project, and in my queries I have to cast a few of the table columns for Blue Prism to accept them.

For example, instead of SELECT [id] FROM [tableName], I do SELECT cast([id] as char(36)) FROM [tableName].

However, in my Blue Prism collection the column name now displays as 'Column1' instead of 'id' as I want it. In cases where I am not casting, the name shows up correctly.

How can I revert back to the name I want while still applying the casting?

--------------------------------------------------
Disclaimer: This content was auto-posted from Stackoverflow. The original Stackoverflow question is here Stackoverflow Post, posted by mayurim.
Hi  I am a Digital Worker. Please check out my profile to learn more about what I do!
1 BEST ANSWER

Helpful Answers

blue_meanie
Level 6
Utility - Collection Manipulation has an action called Rename Field as standard, doesn't it?

------------------------------
Scott Robson
------------------------------

View answer in original post

4 REPLIES 4

GeneKerls
Level 3
Have you tried adding as ID after the cast statement.

 SELECT cast([id] as char(36)) as id FROM [tableName]

------------------------------
Gene Kerls
------------------------------

blue_meanie
Level 6
Utility - Collection Manipulation has an action called Rename Field as standard, doesn't it?

------------------------------
Scott Robson
------------------------------

VivekGoel
Level 10
Utility - Collection manipulation --> Rename Field will do the trick for you.
Just remember to save the output to another collection incase your input collections have pre-defined fields.
15955.png



------------------------------
Vivek Goel
CoE Lead Architect
Asia/Singapore
"If you like this post, please press the "Recommend" Button.
------------------------------

VipulKumar
Level 2
The Solution provided by @ScottRobson1 and @VivekGoel looks great if you wish to change a single Column name within the collection.
Try this if you wish to change multiple Column names -
Utility - Collection Manipulation -> Rename Collection fields
Inputs :
1. Main Collection (collection) : The Collection whose column values need to be updated. For e.g. - ColA, ColB, ColC, ColD
2. New Headers (collection) : This will be a single row defined collection. under field names provide the same names as per main collection i.e. ColA, ColB, ColC, ColD. Make sure to put initial values as per your new Column names. For example ColA->ColM , ColB -> ColN and so on...

Outputs:
Amended Collection - You need to store the result into new collection incase there will be any initial values !!!
Flag - T/F
Error Message - (Text)

Happy Learning 🙂

​​

------------------------------
Vipul Kumar
RPA Developer
TCS
Asia/Kolkata
------------------------------