cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
UserAdmin2021
New Member

Create a csv column using 2 values with a space

Hello. I'm really sorry, this such a basic query but I'm fairly new to all of this and I've searched for an answer and can't find one!

 

I'm creating a csv list from a SharePoint list and I'd like one of my columns to have a value of 'FirstName SPACE LastName'. I cannot for the life of me, work out how to add a space between the 2 values! Help! Please 😐

 

Thank you! 😁 

1 ACCEPTED SOLUTION

Accepted Solutions
Paulie78
Super User III
Super User III

Sorry, I made an error in the expression:

 

concat(item()['First_x0020_Name'], ' ', item()['Last_x0020_Name'])

 

View solution in original post

13 REPLIES 13
Paulie78
Super User III
Super User III

two different ways:

  1. using the concat expression. Something like concat(outputs('firstName'), ' ', outputs('surname') - you would need to replace "outputs('firstName)" with whatever your field values are.
  2. Easier - you can just select your dynamic content, pick the first name, literally press space, pick the second name from dynamic content.

Make sense?

soysalf
Resolver I
Resolver I

Hi @UserAdmin2021 ,

 

For the column that you want the full name you can use the concat expression

soysalf_0-1619084977953.png

Your expression will look like something as below.

concat([Your Dynamic Value for first name],' ',[Your dynamic value for last name])
UserAdmin2021
New Member

Thank you both. I've tried using the space bar but that doesn't work!

The concat option gives me an error 😞

 

Untitled.png

Paulie78
Super User III
Super User III

It's because [First Name] as you have written it. Is not a valid expression and does not represent a value. Try this:

  • Remove everything you have put in that field.
  • Insert "First name" from dynamic content into that field. Click the ellipsis (three little dots in the top right of the action) - Choose "Peek Code".
  • From the peek code section, copy the expression/code being used for "First name". 
  • Use the code you have copied as the basis for forming both the first and last name values for your concat expression.

Try that and see how you get on/ 

ok, so that gives:

concat([First_x0020_Name],' ',[Last_x0020_Name])

 

But it still errors 😞

Paulie78
Super User III
Super User III

you need a bit more than that. I expect it is:

item()['[First_x0020_Name]']

So your whole expression would be:

concat(item()['[First_x0020_Name]'], ' ', item()['[Last_x0020_Name]'])

 

Thanks, I've tried that but now I get this error:

 

The execution of template action 'Create_CSV_table' failed. The column values could not be evaluated: 'The template language expression 'concat(item()['[First_x0020_Name]'], ' ', item()['[Last_x0020_Name]'])' cannot be evaluated because property '[First_x0020_Name]' doesn't exist, available properties are '@odata.etag, ItemInternalId, ID, Title, First_x0020_Name, Last_x0020_Name, Job_x0020_Title, Mobile_x0020_Phone_x0020_Number, Department, Department#Id, Office_x0020_Location, Office_x0020_Location#Id, Manager, Manager#Claims, Start_x0020_Date, Status, Status#Id, Phone_x0020_number, Modified, Created, Author, Author#Claims, Editor, Editor#Claims, {Identifier}, {IsFolder}, {Thumbnail}, {Link}, {Name}, {FilenameWithExtension}, {Path}, {FullPath}, {ContentType}, {ContentType}#Id, {HasAttachments}, {VersionNumber}'. Please see https://aka.ms/logicexpressions for usage details.'.

Paulie78
Super User III
Super User III

Sorry, I made an error in the expression:

 

concat(item()['First_x0020_Name'], ' ', item()['Last_x0020_Name'])

 

View solution in original post

Thank you - so that works, BUT it's putting the value into the csv with no space between the firstname and the surname 😞

Paulie78
Super User III
Super User III

Are you sure you copied the expression exactly? You need a space in the right spot, try this just to confirm it is work:

concat(item()['First_x0020_Name'], 'SPACE_HERE', item()['Last_x0020_Name]'])

and you should get SPACE_HERE between the first and last name

UserAdmin2021
New Member

ok, so it did create it properly, but now I have another error 😞 it really isn't going well for me today!

 

The file gets created, but the next step to get the file content before sending via FTP now fails - it worked earlier?! Arrrrrrrgh!

 

UserAdmin2021_0-1619098018664.png

 

Thanks Paulie!

 

 

Paulie78
Super User III
Super User III

you have just put in "newusers.csv" and expected the get file content action to find it, which it will not. You need to either:

  • Use the action "Get file content using path" instead (and provide it with the full path).
  • Use the current action and provide it with the unique ID of the CSV file, which you can get from the dynamic output of your create file action.

Make sense? Really it is a separate question.

You are a LEGEND Paulie - thank you SO much! I am one very happy lady - all working! 😁

Helpful resources

Announcements
MPA User Group

Welcome to the User Group Public Preview

Check out new user group experience and if you are a leader please create your group

MBAS on Demand

Microsoft Business Applications Summit sessions

On-demand access to all the great content presented by the product teams and community members! #MSBizAppsSummit #CommunityRocks

MBAS Attendee Badge

Claim Your Badge & Digital Swag!

Check out how to claim yours today!

secondImage

Are Your Ready?

Test your skills now with the Cloud Skill Challenge.

Top Solution Authors
Top Kudoed Authors
Users online (44,886)