title: Can I use a ForAll and UpdateIf within a local offline Powerapps collection?
body: <p>Can anyone help?I need assistance to collect multiple records in a gallery and save it to a local collection when offline.
  When my app is connected, my script uses a ForAll to go through all the gallery items then if the Question ID matches the ID in the gallery, it patches the records to the SQL database. This part works fine.
  However, when offline, I collect the items and save them to a local collection called LocalAnswers. It only saves 1 record (instead of 20) and does not pull in the Question ID. I have tried inserting a ForAll and UpdateIf within my Collect function but can't seem to get it right. Any ideas?</p>
  <pre><code>If(
      Connection.Connected,
      ForAll(
          Gallery2.AllItems,
          UpdateIf(
              AuditAnswers,
              ID = Value(IDGal.Text),
              {
                  AuditID: IDAuditVar,
                  Answer: Radio1.Selected.Value,
                  Action: ActionGal.Text,
                  AddToActionPlan: tglAction.Value
              }
          )
      ),
      Collect(
          LocalAnswers,
          {
              AuditID: IDAuditVar,
              Answer: Radio1.Selected.Value,
              Action: ActionGal.Text,
              AddToActionPlan: tglAction.Value
          }
      )
  );
  </code></pre>