cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Highlighted
Frequent Visitor

Delete item from SP list, using different datasources (calendars).

Hey all.

I have created a custom Calendar app linked to 30 SP-lists (different calendars for conference rooms - without Outlook-connector).

After selecting the right calendar, the variable 'CaltoUse' is set to 'Calendar#' - ex Set(CaltoUse,Calendar1).

In the CalenderEventsGallery on the next screen I use for 'Items' the Switch-function to connect to the corresponding calendar (SPlist 'Cal#') - ex. Switch(CaltoUse, "Calendar1",Cal1,"Calendar2",Cal2).

In every datacard I have an Icon (icnDelete) and I want to delete the selected record when pressed. 

 

Question: what is the right formula to achieve this?

 

Remove (Cal1, ThisItem) works, but I want to implement the right calendar, depending on the variable CaltoUse.

Remove (Switch(CaltoUse, "Calendar1",Cal1,"Calendar2",Cal2), ThisItem) doesn't work.

Any ideas?

Thanks in advance

1 ACCEPTED SOLUTION

Accepted Solutions
Highlighted

Hey, as I have 30+ calendars, 'IF' would be hard to create. But, you made me realise that I needed to put the Remove in the Switch function and not the other way.

So I have: Switch(CaltoUse; "Calendar1";Remove(Cal1;ThisItem);"Calendar2";Remove(Cal2;ThisItem);"Calendar3";Remove(Cal3;ThisItem) ...) and it works!

Thanks for the help in rearranging the statements!

View solution in original post

3 REPLIES 3
Highlighted
Community Support
Community Support

Hi @Verlet ,

 

Please change to use If() function, instead of Switch(), like this.

If(CaltoUse="Calendar1",Remove(Cal1,ThisItem),CaltoUse="Calendar2",Remove(Cal2,ThisItem))

Hope this helps.

Sik

Highlighted

Hey, as I have 30+ calendars, 'IF' would be hard to create. But, you made me realise that I needed to put the Remove in the Switch function and not the other way.

So I have: Switch(CaltoUse; "Calendar1";Remove(Cal1;ThisItem);"Calendar2";Remove(Cal2;ThisItem);"Calendar3";Remove(Cal3;ThisItem) ...) and it works!

Thanks for the help in rearranging the statements!

View solution in original post

Highlighted

Hi @Verlet ,

 

Of course, the Switch() function is the first choice, but it still can't work in my test, so I changed to use If function.

Anyway, it helps, right.

Sik

Helpful resources

Announcements
Community Conference

Power Platform Community Conference

Check out the on demand sessions that are available now!

News & Announcements

Community Blog

Stay up tp date on the latest blogs and activities in the community News & Announcements.

secondImage

Power Platform 2020 release wave 2 plan

Features releasing from October 2020 through March 2021

Community Highlights

Community Highlights

Check out the Power Platform Community Highlights

Top Solution Authors
Top Kudoed Authors
Users online (2,117)