Skip to content

Commit

Permalink
📝 Update set variable documentation to include Pop/Shift operations
Browse files Browse the repository at this point in the history
Closes #1651
  • Loading branch information
baptisteArno committed Nov 12, 2024
1 parent 5546d11 commit badad22
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 1 deletion.
4 changes: 4 additions & 0 deletions apps/docs/editor/blocks/logic/set-variable.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -168,6 +168,10 @@ Only available in WhatsApp. This will set your variable with the user's phone nu

Only available in WhatsApp. This will set your variable with the user's name.

## Pop / Shift

Pop removes the **last** item from the list variable that you provide and it will set the removed item into the "Popped item" variable. Shift does the same with the **first** item of the list. These are especially useful when you need to [create a loop](../../../guides/how-to-create-loops) that processes each item of a list.

## Save in results

By default, new variables are not persisted in the [Results](../../../results) table. They are only stored for the current user chat session. Enabling this option will save the variable in the `Results` table.
Expand Down
2 changes: 1 addition & 1 deletion packages/scripts/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@
"getCoupon": "tsx src/getCoupon.ts",
"redeemCoupon": "tsx src/redeemCoupon.ts",
"exportResults": "tsx src/exportResults.ts",
"updateUserEmail": "tsx src/updateUserEmail.ts",
"updateUserEmail": "SKIP_ENV_CHECK=true tsx src/updateUserEmail.ts",
"inspectChatSession": "tsx src/inspectChatSession.ts",
"deleteChatSession": "tsx src/deleteChatSession.ts",
"checkDependencies": "tsx src/checkDependencies.ts",
Expand Down

0 comments on commit badad22

Please sign in to comment.