2

I have a text input called ImageTextInput in my canvas power app, and I want to use it to allow the user (as they are uploading an image to a Sharepoint list) to give a custom name to that image. I created a variable called imageName to store the name that the user types into the ImageTextInput box.

When I upload an image and type in a the name "MyImage" into the ImageTextInput box, this power app gives my image attachment a blank name ".jpg". Then if I upload a second image and type in "CoolImage" into the ImageTextInput box, then the power app gives my image attachment the name "MyImage.jpg". In other words, the image name seems to be generated (using the Camera Control OnSelect code shown below) before the user-entered text is stored into the imageName variable. Why is that?

Set(imageName,ImageTextInput.Text);
UpdateContext({showDialogBox: true});

Collect(
colImages,
{
DisplayName: imageName & ".jpg",
Id: imageName & ".jpg",
Value: Camera1.Photo
}
);

I tried one other thing: for the OnChange and Onselect code of the ImageTextInput field, I used this code below to make sure the imageName variable is continuously being updated, but that didn't help. How I can get this image to be created AFTER the user-entered text is stored into the imageName variable? Without a lag?

Set(imageName,ImageTextInput.Text);

This is the ImageTextInput component where the user is prompted to enter a name for the image

shampouya
  • 386
  • 1
  • 6
  • 24

1 Answers1

0

I think your code is fine like i used your code

and i think you just want to add user name while capturing image

so Code that i write

first input i took as omkar

second input i took as viraj

This was the output of colletion

and i write code on onselect property of button control

  • Please add code and data as text ([using code formatting](/editing-help#code)), not images. Images: A) don't allow us to copy-&-paste the code/errors/data for testing; B) don't permit searching based on the code/error/data contents; and [many more reasons](//meta.stackoverflow.com/a/285557). Images should only be used, in addition to text in code format, if having the image adds something significant that is not conveyed by just the text code/error/data. – Suraj Rao Nov 11 '22 at 11:56
  • As it’s currently written, your answer is unclear. Please [edit] to add additional details that will help others understand how this addresses the question asked. You can find more information on how to write good answers [in the help center](/help/how-to-answer). – Community Nov 24 '22 at 15:12