Skip to main content

Notifications

Power Apps - Power Apps Pro Dev & ISV
Unanswered
Posted on 22 Nov 2024 10:24:59 by 4
Hi,
I have a need: only when all the records of the Movimag table are with the Evaso_SN=S field, I have to make the patch on the Tesdocum table, putting the Evaso_SN field with the value "N".
This script gives me this value when it finds even just one record in the Movimag table with the Evaso_SN field with an "S" value.
Instead, I would like only if all Movimag records are "S" shaped.
Where am I wrong?
Can you give me a suggestion?
Thanks in advance
 
ForAll(
    Filter(
        MOVIMAG;
        NUMERO = BrowseGallery1.Selected.NUMERO
    );
    If(
        EVASION_SN = "S";
        Patch(
            TESDOCUM;
            LookUp(
                TESDOCUM;
                NUMERO = Gallery1.Selected.NUMERO
            );
            {EVASO_SN: "S"}
        )
    )
 
 
query.png
  • WarrenBelz Profile Picture
    WarrenBelz 143,081 on 24 Nov 2024 at 05:54:15
    For All
    OK - assuming you want the first filter and if all items in that are "S" then post "S" to the other list ? Note the structure could be a little shorter if Delegation was not an issue.
    With(
       {
          _Base:
          Filter(
             MOVIMAG;
             NUMERO = BrowseGallery1.Selected.NUMERO
          )
       };
       With(
          {
             _Data:
             Filter(
                _Data;
                EVASION_SN = "S"
             )
          );
          If(
             CountRows(_Base) = CountRows(_Data);
             ForAll(
                _Base As _Items;
                Patch(
                   TESDOCUM;
                   LookUp(
                      TESDOCUM;
                      NUMERO = _Items.NUMERO
                   );
                   {EVASO_SN: "S"}
                )
             )
          )
       )
    )
     
    Please click Does this answer your question 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 a Like.
    MVP (Business Applications)     Visit my blog Practical Power Apps    Buy me a coffee

      
  • GC-16100911-0 Profile Picture
    GC-16100911-0 4 on 22 Nov 2024 at 11:48:21
    For All
     
     
    Unfortunately it doesn't work.
    I'll try to explain myself better, I need that only when all Movimag records have the Evaso_SN field set to "S", only in this case must the Evasion_SN field be set to "S" in the Tesdocum table.
    Thank you
  • WarrenBelz Profile Picture
    WarrenBelz 143,081 on 22 Nov 2024 at 10:48:40
    For All
    To post "N" to the matching fields
    ForAll(
       Filter(
          MOVIMAG;
          NUMERO = BrowseGallery1.Selected.NUMERO &&
          EVASION_SN = "S"
       ) As _Items,
       Patch(
          TESDOCUM;
          LookUp(
             TESDOCUM;
             NUMERO = _Items.NUMERO
          );
          {EVASO_SN: "S"}
       )
    )
     
    Please click Does this answer your question 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 a Like.
    MVP (Business Applications)     Visit my blog Practical Power Apps    Buy me a coffee

     

Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

Quick Links

October 2024 Newsletter…

October 2024 Community Newsletter…

Community Update Oct 28…

Power Platform Community Update…

Tuesday Tip #4 How to Conntact Support…

Welcome to a brand new series, Tuesday Tips…

Leaderboard

#1
WarrenBelz Profile Picture

WarrenBelz 143,081

#2
RandyHayes Profile Picture

RandyHayes 76,308

#3
Pstork1 Profile Picture

Pstork1 63,795

Leaderboard