cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
CABIRD
Level: Powered On

Generate file name

Objective: Automatically generate unique file name for each image. Then use Flow to upload images to SharePoint photo asset library.

 

The code below works

UniqueFileName.png

 

Add textinput (AuditNumber) entry today's date coding  to create the unique file name and fails. See below.

 

DateFileName.png

Clearly I'm missing something obvious.

 

Can you help?

 

Thank you.  

 

 

2 ACCEPTED SOLUTIONS

Accepted Solutions
CABIRD
Level: Powered On

Re: Generate file name

Hello

THIS ISN'T A SOLUTION

 

The below is a response to the previous question raised by wyotim the input text has an integer but I'd set this to text.  My intention is to convert an integer to text.

 

Text input set to 'text' not 'number.' In theory the code should work. 

 

Collect(PictureList,
			{ Image: UploadedImage1.Image, 
				ID: Concatenate(AuditNumber.Text,
				"-",
				Text(Today(),
				"[$-en-US][$-en US]dd:mm:yy"),
				"-",Text(CountRows(PictureList)+1),
				".jpg")
			}
		)

 

TextBox.png

Community Support Team
Community Support Team

Re: Generate file name

Hi @CABIRD ,

 

Could you please reference this:

Collect(PhotoList,{Photo:UploadedImage1.Image,FileName:Concatenate("File",Text(Today(),"[$-en-US]dd/mm/yyyy"),Text(CountRows(PhotoList)),".jpg")})

 

And I test with your formula expression, it works ok.

Collect(PictureList,
{ Photo: UploadedImage1.Image,
ID: Concatenate(AuditNumber.Text,
"-",
Text(Today(),
"[$-en-US]dd:mm:yy"),
"-",
Text(CountRows(PictureList)+1),
".jpg")
}
)

20190417collection1.PNG

 

Best Regards.

Yumia

6 REPLIES 6
Super User
Super User

Re: Generate file name

I may be looking at this wrong, but it looks like you are trying to put the file name in the ID field, which previously held an integer (or at least number) value. I would guess that you would want another place for that name, like a PictureName field or something like that. 

CABIRD
Level: Powered On

Re: Generate file name

Hello

THIS ISN'T A SOLUTION

 

The below is a response to the previous question raised by wyotim the input text has an integer but I'd set this to text.  My intention is to convert an integer to text.

 

Text input set to 'text' not 'number.' In theory the code should work. 

 

Collect(PictureList,
			{ Image: UploadedImage1.Image, 
				ID: Concatenate(AuditNumber.Text,
				"-",
				Text(Today(),
				"[$-en-US][$-en US]dd:mm:yy"),
				"-",Text(CountRows(PictureList)+1),
				".jpg")
			}
		)

 

TextBox.png

Community Support Team
Community Support Team

Re: Generate file name

Hi @CABIRD ,

 

Thanks for your post and your solution.

 

Best Regards.

Yumia

CABIRD
Level: Powered On

Re: Generate file name

Hello @v-yuxima-msft 

You misunderstood my submission.

 

Sorry my above submission isn't a solution. In theroy it should work but it simply doesn't. 

 

The code below functions. 

 

Collect(PictureList,{ Photo: Camera1.Photo, ID: CountRows(PictureList)+1 })

However expand the above code to the to the code  below

Collect(PictureList,
   { Photo: Camera1.Photo,
   ID: Concatenate(AuditNumber.Text,
   "-",
   Text(Today(),
   "[$-en-US]dd:mm:yy"),
   "-",
   Text(CountRows(PictureList)+1),
   ".jpg")
   }
  )
  

CodeError.png

The above implies Power Apps has a bug if the code  above is correct.  I would like to state the code worked in the past WITHOUT ISSUE.

 

Non descript error messages.

Issue1.pngIssue2.pngIssue3.pngissue4.pngIssue5.png

Can you help?

 

P.S. I cannot imagine there isn't a method to generate file names with meta data to upload to SharePoint list.

 

Thank you.

Community Support Team
Community Support Team

Re: Generate file name

Hi @CABIRD ,

 

Could you please reference this:

Collect(PhotoList,{Photo:UploadedImage1.Image,FileName:Concatenate("File",Text(Today(),"[$-en-US]dd/mm/yyyy"),Text(CountRows(PhotoList)),".jpg")})

 

And I test with your formula expression, it works ok.

Collect(PictureList,
{ Photo: UploadedImage1.Image,
ID: Concatenate(AuditNumber.Text,
"-",
Text(Today(),
"[$-en-US]dd:mm:yy"),
"-",
Text(CountRows(PictureList)+1),
".jpg")
}
)

20190417collection1.PNG

 

Best Regards.

Yumia

Highlighted
CABIRD
Level: Powered On

Re: Generate file name

Hello @v-yuxima-msft 

 

I note the date format change. Previosuly dd:mm:yy now dd/mm/yy I clearly missed the format change. Even worse it never occurred to me date format was the issue despite testing line by line.

 

Thank you for your help much appreciated.

Helpful resources

Announcements
firstImage

PowerApps Monthly Community Call!

Join us next Wednesday for our Demo Extravaganza, October 16, 2019 8am PDT.

firstImage

Microsoft Business Applications Virtual Launch Event

Join us for an in-depth look at the new innovations across Dynamics 365 and the Microsoft Power Platform.

firstImage

Watch Sessions On Demand!

Continue your learning in our online communities.

Power Platform 2019 release wave 2 plan

Power Platform 2019 release wave 2 plan

Features releasing from October 2019 through March 2020

FirstImage

Power Platform World Tour

Coming to a city near you

thirdimage

PowerApps Community User Group Member Badge

Fill out a quick form to claim your user group badge now!

FourthImage

Join PowerApps User Group!!

Connect, share, and learn with your peers year-round

SecondImage

Power Platform Summit North America

Register by September 5 to save $200

Top Kudoed Authors
Users Online
Currently online: 195 members 4,353 guests
Please welcome our newest community members: