Run add row action on rows referenced rows

Hi, short time lurker here! New to AppSheets and come from a non-technical background. I have fallen in love with AppSheets and am trying to learn more about it and using it more in my daily personal and work life. 

Right now, as I am trying to get to know the app I am making a Checklist Application. I want to generate a list of yes/no questions based on the checklist frequency "type". I want the user to be able to quickly and easily add and remove questions as needed.

Question:

I have a Table "Questions", with a WORKING Action (Create Question Entry) that adds the [Question] to an "Entries" Table and refers the [Question] ref column back to [_ThisRow] and refers the Date column to the MAX() Date of that "Frequency". Currently, the Application's Workflow has the User "Start a Checklist" with a deck view of the Table "Frequency" with options Daily, Weekly, Monthly, Quarterly, or Annual. They select an Action that Creates an "Entry Date" related to [_ThisRow].

The creation of this related "Date" triggers a bot that is SUPPOSED to run the Process:

  1. data change - Add
    1. Condition: AND([isMostRecent] = true, [DailyProcessed] = false )
  2. run a data action
    1. Run Action on Rows
      1. Referenced Table: Questions
      2. Referenced Rows: Select(Questions[Question], [Frequency] = Daily)
      3. Referenced Action: "Create Question Entry"
  3. wait
    1. Condition:
      1. LOOKUP(
        TODAY(),
        "Dates",
        "Date",
        "DailyEntryCount"
        ) = COUNT(
        SELECT(
        Questions[Question],
        ([Frequency] = "Daily")
        )
        )

  4. Run a Data Action
    1. Set Row Values
      1. [DailyProcessed] = True

As soon as I run the Action to create a new Entry Date that kicks off the Automation, the [DailyProcessed] gets switched over to true immediately and it wont add any rows.

I want to hope its just step 2.1.2 but I might just be unable to do it this way all together. I am open to exploring other methods. I found a couple templates that used like an EnumList in a form view that decided what rows got generated but it did not look like it would work with my table structure..

Table Structure

Table: Questions

Row IDQuestion (text)Frequency (Ref)

Table: Frequency

Row IDFrequency (Enum)

Table: Dates

Row IDDate (Date)Frequency (ref)Daily Processed (y/n)

Table: Entries

Row IDFrequency (LookupRef)Date (ref)Response (Text)Question (ref) 

 

Bot Test Error

Failed: Error: 'Execute an Action on a Set of Rows' Data action 'Action for New Entry' for table 'Dates failed with exception Cannot get key values when Parent or ChangeImage are null.

{
  "$type": "Nirvana.Data.TaskResultTakeAction, V2API",
  "AppWorkflowRuleOrProcessName": "Process for New Bot - 1",
  "ActionName": "Action for New Entry",
  "Changes": {
    "$id": "1",
    "$type": "ChangeOperations.Changes, ChangeOperations",
    "ListChanges": [
      {
        "$id": "2",
        "$type": "ChangeOperations.Change, ChangeOperations",
        "AfterImage": [
          "1",
          "UQsn3Gicv6AQtvu9ku7HAg",
          "05/30/2024",
          "l3uvcYlK7N4m2N9EpRlfDb",
          "",
          "Y",
          "N",
          "gNx0VImL3aMt20u15MGZFn",
          "",
          "TRUE",
          "05/30/2024",
          "1"
        ],
        "AfterImageOriginal": null,
        "BeforeImage": null,
        "BeforeImageOriginal": null,
        "ChangeImage": null,
        "ChangeImageToLog": [],
        "ChangeImageSavedImages": null,
        "ProcessStateDataChange": null,
        "MustReadBeforeOrAfterImage": false,
        "OpTypePerformed": "Update",
        "TableName": null
      }
    ]
  },
  "AppErrors": {
    "$type": "Jeenee.DataTypes.AppErrors, Jeenee.DataTypes",
    "RecordInfo": false,
    "RecordWarning": true,
    "AnnotateErrors": false,
    "Errors": []
  },
  "TaskType": "TakeAction",
  "TaskName": "Action for New Entry"
}

 

Solved Solved
0 2 1,589
1 ACCEPTED SOLUTION

Thanks for taking the time to come back to this.

Again, I am non-technical background so ultimately, I think I was trying to cobble looping together without knowing what looping is.

I also got hung up Normalization and thinking Dates should be their own Entity instead of an Attribute which made things more complicated. 

 

Although, I have been spending quite a bit of time on AppSheet since this question and looking back this was a weird situation I don't have the app anymore so I can't go back to it, but..

Essentially, I had a Table for template questions and when you clicked the button it created a question on a seperate table and related it to the most recent Date  and it worked (the logs it generated weren't "null").

Then I set up a Bot that would basically go down the list and press the button when I manually added a new date to the Date table, but when it ran it would fail and return "null". Most definitely something wrong with the Expressions but

Looping ended up being a lot easier and more flexible for my data schema. 

View solution in original post

2 REPLIES 2

I'm finding this extremely hard to follow. Can you give a high-level summary of the functionality that you're trying to build? Screenshots are also typically very helpful.

 

Thanks for taking the time to come back to this.

Again, I am non-technical background so ultimately, I think I was trying to cobble looping together without knowing what looping is.

I also got hung up Normalization and thinking Dates should be their own Entity instead of an Attribute which made things more complicated. 

 

Although, I have been spending quite a bit of time on AppSheet since this question and looking back this was a weird situation I don't have the app anymore so I can't go back to it, but..

Essentially, I had a Table for template questions and when you clicked the button it created a question on a seperate table and related it to the most recent Date  and it worked (the logs it generated weren't "null").

Then I set up a Bot that would basically go down the list and press the button when I manually added a new date to the Date table, but when it ran it would fail and return "null". Most definitely something wrong with the Expressions but

Looping ended up being a lot easier and more flexible for my data schema. 

Top Labels in this Space