Hi, I'm trying to Create a button which deletes same picture from 2 separate gallery's
For One it works fine but for second it doesn't do anything.
Code On Select:
RemoveIf(Gallery1,DisplayName = ThisItem.DisplayName);
Pictures are saved to two gallery's at same time.
Or should i use another function.
Welp 😄
Solved! Go to Solution.
Hi @HelpWithFlows
You are just check gallery 1, so gallery 1 picture only delete.
RemoveIf(Gallery1,DisplayName = ThisItem.DisplayName);
I have some query about your Apps
1. where to match display name?
2. what are the gallery picture need to delete?
My guess
you are check gallery 1 picture display name matched to delete all gallery matched item
So you coding nee to update
remove if to remove only one data source. so you need to add multiple removeif function to remove what do you need to removed match picture display name.
like below coding
Your matching displayname used to textinputbox called like as TextInput_1.text (selected item). Button press to remove like below
Removeif(gallery1,display=TextInput_1.text );Removeif(gallery2,display=TextInput_1.text );
Please click Accept as solution if my post helped you solve your issue. This will help others find it more readily. It also closes the item. If the content was useful in other ways or you liked the post and want to show some appreciation, please give it a Thumbs Up.
Hi @HelpWithFlows ,
With names like that, there is no relationship between the images and therefore no way of identifying one from the other, so running a command from one gallery cannot possibly delete the item in the other. Firstly, are they both in the same Library ? If so, you will need to delete each from its own gallery. If not, I suggest you simply name them the same.
Please click Accept as solution if my post helped you solve your issue. This will help others find it more readily. It also closes the item. If the content was useful in other ways, please consider giving it Thumbs Up.
Visit my blog Practical Power Apps
Hi, @HelpWithFlows
I can't understand, Give more details about your problem.
What is your requirement and what problem now you faced?
I have an app where User should take a 5 separate pictures to 5 separate gallery's, for example first Gallery is Front of Product, Second is Back of Product. and etc. And there is a main Gallery where all photos of all galleries are stocked.
And it looks like that.
And Gallery looks like that, but if i delete it by button. I just delete from Front Gallery and doesn't do anything with main Gallery.
after deleting there, picture is gone but main gallery still has it.
Main gallery picture still there.
Hi @HelpWithFlows
You are just check gallery 1, so gallery 1 picture only delete.
RemoveIf(Gallery1,DisplayName = ThisItem.DisplayName);
I have some query about your Apps
1. where to match display name?
2. what are the gallery picture need to delete?
My guess
you are check gallery 1 picture display name matched to delete all gallery matched item
So you coding nee to update
remove if to remove only one data source. so you need to add multiple removeif function to remove what do you need to removed match picture display name.
like below coding
Your matching displayname used to textinputbox called like as TextInput_1.text (selected item). Button press to remove like below
Removeif(gallery1,display=TextInput_1.text );Removeif(gallery2,display=TextInput_1.text );
Please click Accept as solution if my post helped you solve your issue. This will help others find it more readily. It also closes the item. If the content was useful in other ways or you liked the post and want to show some appreciation, please give it a Thumbs Up.
Thanks, but it seems that
RemoveIf(Gallery1,DisplayName = ThisItem.DisplayName);
RemoveIf(GalleryMain,DisplayName = ThisItem.DisplayName);
It still doesn't work and main Gallery isn't effected at all.
Collecting pictures code:
UpdateContext({varName: GUID()});
Collect(
Gallery1,
{
DisplayName: varName & ".jpg",
Id: varName & ".jpg",
Value: UploadedImage1.Image
}
);
UpdateContext({varViskas: GUID()});
Collect(
GalleryMain,
{
DisplayName: varViskas & ".jpg",
Id: varViskas & ".jpg",
Value: UploadedImage1.Image
}
);
Navigate(MenuScreen)
Maybe this ll help
Maybe you know solution if we talk about code?
@WarrenBelz can you support to @HelpWithFlows resolve his problem.. Currently I can't help him.
Thanks for the tag, but you have asked the right questions here.
@HelpWithFlows The issue I think is obvious - they are named with different variables in the Collections (varName and varViskas), so I suspect that the Main gallery item has a different name. There is nothing wrong with the RemoveIf code and should delete both if the files are identically named.
Yea you right, but it seems that Display Names are different .
71b6bc66-df35-4333-898d-9963987c67ae.jpg Gallery1
238fdf87-dcef-48c2-82d1-c9a8aec43c76.jpg MainGallery
So what is solutions? Use Same Collection? Or there is another solution?
Hi @HelpWithFlows ,
With names like that, there is no relationship between the images and therefore no way of identifying one from the other, so running a command from one gallery cannot possibly delete the item in the other. Firstly, are they both in the same Library ? If so, you will need to delete each from its own gallery. If not, I suggest you simply name them the same.
Please click Accept as solution if my post helped you solve your issue. This will help others find it more readily. It also closes the item. If the content was useful in other ways, please consider giving it Thumbs Up.
Visit my blog Practical Power Apps
User | Count |
---|---|
253 | |
125 | |
106 | |
50 | |
49 |