Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
1.3k views
in Technique[技术] by (71.8m points)

microsoft teams - PowerApps: Data table as context variable for deletion confirmation modal

I'm currently trying to create a Microsoft Teams Canvas App using Microsoft PowerApps. Within my App I've got different galleries displaying the data of different data tables. Now I've implemented a confirmation modal for data deletion, but unfortunately I'm not possible to pass the table itself to a context variable to perform a dynamic deletion.

What I've tried is the following:

My deletion trigger for my streams table sets a table identifier and the item to be removed. Also they call the modal:

If(
  !IsBlank(_galStreams.Selected);
  UpdateContext({
      RemoveFrom: 1;
      ToRemove: _galStreams.Selected}
  );; 
  Set(ModalActiveRemove;true)
)

The same trigger is existing for a second gallery with another Identifier (2).

Now on my deletion confirmation I've added the following logic to the confirmation symbol:

Switch(
  RemoveFrom;
  1; Remove(streams; ToRemove);
  2; Remove(objectives; ToRemove)
);;
UpdateContext({
  ToRemove: Blank(); 
  RemoveFrom: Blank()
});;
Set(ModalActiveRemove; false)

When working with only the streams trigger and table (so only one case) everything is working as supposed. But as soon as I try to use the second trigger, the "ToRemove" item is not identified as part of the second table and I'll receive an incompatible type error.

Is there any way to achieve a correct behavior?

Best regards


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Answer

0 votes
by (71.8m points)
等待大神答复

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...