cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Gazbeer
Helper III
Helper III

Create multiple new records from a gallery

Hi all,

 

Been racking my brain how is best to streamline an app I've made. 

 

It is a PPE app which stores all PPE issued to staff. When a new item is issued the manager can select which item the want to replace which then archives the old item and creates a new one in its spot. 

 

However is it possible that the manager could select 10 records from a gallery for example and create a new item for each item selected?

 

I was thinking a checkbox in the gallery, then collecting all the data of items selected. 

 

On a second screen have a gallery with the collection.

 

But I dont know if there is a way to have a formula that would create a new item to replace every item in that gallery? 

 

Hope that makes sense!

 

Appreciate any help or suggestions with this. 

 

Thanks

 

Gaz

5 REPLIES 5
v-bofeng-msft
Community Support
Community Support

Hi @Gazbeer :

Do you want to replace the 10 records you selected with a new record?

If so,I've made a test for your reference:

I assume the gallery's data source is a collection:

ClearCollect(
GalleryItem,
{ID:1,title:"No1"},
{ID:2,title:"No2"},
{ID:3,title:"No3"},
{ID:4,title:"No4"},
{ID:5,title:"No5"}
)

 1\Add a gallery(Gallery4) and set it's items property to:

GalleryItem

2\Add a checkbox(Checkbox1) into Gallery4

3\Add a button and set it's OnSelect property to:

Set(
    GalleryAllItems,
    Gallery4.AllItems
);
Update(
    GalleryItem,
    LookUp(
        GalleryItem,
        ID in Filter(
            GalleryAllItems,
            Checkbox1.Value
        ).ID
    ),
    { ID: 99,title: "Test"} /*Here is the new record*/
);
Remove(
    GalleryItem,
    Filter(
        GalleryItem,
        ID in Filter(
            GalleryAllItems,
            Checkbox1.Value
        ).ID
    )
)

24.gif

Best Regards,

Bof

Hi Bof. 

 

Thank you for your fast reply. They are on a sharepoint database. Can it still be done?

 

Yes so in essence. The items selected will go to an archive by changing a on/off switch so they won't be seen in a gallery, and the new item will be seen. The  new item created is  with the same credentials as the item archived. 

 

 

Hi @Gazbeer :

Q1:Thank you for your fast reply. They are on a sharepoint database. Can it still be done?

Yes

Q2:The items selected will go to an archive by changing a on/off switch so they won't be seen in a gallery, and the new item will be seen. The  new item created is  with the same credentials as the item archived. 

Could you tell me:

  • What is archive?How to go to the archive?(The items selected will go to an archive by changing a on/off)
  • Do you want to delete the selected items directly or hide them in the gallery?(they won't be seen in a gallery)
  • What is credential?Is it a column?What is it's data type?(with the same credentials)

Best Regards,

Bof

Hi Bof,

 

Archive is just a column name. Its just a way I hide old items from a gallery. I need to be able to look back on old records but not see them all the time. 

 

So the user selects which items they are replacing in a gallery by using a checkbox as you have perviously described. Then a patch to change the archive column from true/false. 

 

Then I need a new record creating for each of the items that were archived. 

 

I'm thinking that maybe creating a collection of the items to be replaced. with 2 galleries referencing the collection. Then patch the items in the old gallery and use patch to create the new items in the second gallery?

 

Would that work?

 

Many thanks

 

Gaz

Hi @Gazbeer :

Sorry I can't understand your needs.

Maybe you could try it and describe the detailed steps and background.

  • If it works, congratulations.
  • If there is a problem, you can consider telling us which requirement is not fulfilled.

Best Regards,

Bof

Helpful resources

Announcements
UG GA Amplification 768x460.png

Launching new user group features

Learn how to create your own user groups today!

Community Connections 768x460.jpg

Community & How To Videos

Check out the new Power Platform Community Connections gallery!

M365 768x460.jpg

Microsoft 365 Collaboration Conference | December 7–9, 2021

Join us, in-person, December 7–9 in Las Vegas, for the largest gathering of the Microsoft community in the world.

Top Solution Authors
Top Kudoed Authors
Users online (1,697)