diff --git a/apps/builder/src/features/blocks/integrations/googleSheets/components/GoogleSheetsNodeContent.tsx b/apps/builder/src/features/blocks/integrations/googleSheets/components/GoogleSheetsNodeContent.tsx
index b0d3006df45..f1009e7a8cf 100644
--- a/apps/builder/src/features/blocks/integrations/googleSheets/components/GoogleSheetsNodeContent.tsx
+++ b/apps/builder/src/features/blocks/integrations/googleSheets/components/GoogleSheetsNodeContent.tsx
@@ -1,13 +1,33 @@
import React from 'react'
-import { Text } from '@chakra-ui/react'
-import { GoogleSheetsAction } from '@typebot.io/schemas'
+import { Stack, Text } from '@chakra-ui/react'
+import { GoogleSheetsAction, GoogleSheetsOptions } from '@typebot.io/schemas'
+import { useTypebot } from '@/features/editor/providers/TypebotProvider'
+import { SetVariableLabel } from '@/components/SetVariableLabel'
type Props = {
- action?: GoogleSheetsAction
+ options?: GoogleSheetsOptions
}
-export const GoogleSheetsNodeContent = ({ action }: Props) => (
-
- {action ?? 'Configure...'}
-
-)
+export const GoogleSheetsNodeContent = ({ options }: Props) => {
+ const { typebot } = useTypebot()
+ return (
+
+
+ {options?.action ?? 'Configure...'}
+
+ {typebot &&
+ options?.action === GoogleSheetsAction.GET &&
+ options?.cellsToExtract
+ .map((mapping) => mapping.variableId)
+ .map((variableId, idx) =>
+ variableId ? (
+
+ ) : null
+ )}
+
+ )
+}
diff --git a/apps/builder/src/features/blocks/integrations/googleSheets/components/GoogleSheetsSettings.tsx b/apps/builder/src/features/blocks/integrations/googleSheets/components/GoogleSheetsSettings.tsx
index cf69b3c1cee..1c089429f98 100644
--- a/apps/builder/src/features/blocks/integrations/googleSheets/components/GoogleSheetsSettings.tsx
+++ b/apps/builder/src/features/blocks/integrations/googleSheets/components/GoogleSheetsSettings.tsx
@@ -304,12 +304,17 @@ const ActionOptions = ({
- Rows to filter
+ Select row(s)
-
+
+
-
>
)}
diff --git a/apps/builder/src/features/graph/components/nodes/block/BlockNodeContent.tsx b/apps/builder/src/features/graph/components/nodes/block/BlockNodeContent.tsx
index 60c3edb88ef..753391198f6 100644
--- a/apps/builder/src/features/graph/components/nodes/block/BlockNodeContent.tsx
+++ b/apps/builder/src/features/graph/components/nodes/block/BlockNodeContent.tsx
@@ -159,11 +159,7 @@ export const BlockNodeContent = ({ block, indices }: Props): JSX.Element => {
case LogicBlockType.CONDITION:
return
case IntegrationBlockType.GOOGLE_SHEETS: {
- return (
-
- )
+ return
}
case IntegrationBlockType.GOOGLE_ANALYTICS: {
return
diff --git a/packages/bot-engine/blocks/inputs/pictureChoice/injectVariableValuesInPictureChoiceBlock.ts b/packages/bot-engine/blocks/inputs/pictureChoice/injectVariableValuesInPictureChoiceBlock.ts
index 8d29496eaf1..695310137d0 100644
--- a/packages/bot-engine/blocks/inputs/pictureChoice/injectVariableValuesInPictureChoiceBlock.ts
+++ b/packages/bot-engine/blocks/inputs/pictureChoice/injectVariableValuesInPictureChoiceBlock.ts
@@ -20,8 +20,7 @@ export const injectVariableValuesInPictureChoiceBlock =
variable.id === block.options.dynamicItems?.pictureSrcsVariableId &&
isDefined(variable.value)
) as VariableWithValue | undefined
- if (!pictureSrcsVariable || typeof pictureSrcsVariable.value === 'string')
- return block
+ if (!pictureSrcsVariable) return block
const titlesVariable = block.options.dynamicItems.titlesVariableId
? (variables.find(
(variable) =>
@@ -29,6 +28,10 @@ export const injectVariableValuesInPictureChoiceBlock =
isDefined(variable.value)
) as VariableWithValue | undefined)
: undefined
+ const titlesVariableValues =
+ typeof titlesVariable?.value === 'string'
+ ? [titlesVariable.value]
+ : titlesVariable?.value
const descriptionsVariable = block.options.dynamicItems
.descriptionsVariableId
? (variables.find(
@@ -38,18 +41,26 @@ export const injectVariableValuesInPictureChoiceBlock =
isDefined(variable.value)
) as VariableWithValue | undefined)
: undefined
+ const descriptionsVariableValues =
+ typeof descriptionsVariable?.value === 'string'
+ ? [descriptionsVariable.value]
+ : descriptionsVariable?.value
+
+ const variableValues =
+ typeof pictureSrcsVariable.value === 'string'
+ ? [pictureSrcsVariable.value]
+ : pictureSrcsVariable.value
+
return {
...block,
- items: pictureSrcsVariable.value
- .filter(isDefined)
- .map((pictureSrc, idx) => ({
- id: idx.toString(),
- type: ItemType.PICTURE_CHOICE,
- blockId: block.id,
- pictureSrc,
- title: titlesVariable?.value?.[idx] ?? '',
- description: descriptionsVariable?.value?.[idx] ?? '',
- })),
+ items: variableValues.filter(isDefined).map((pictureSrc, idx) => ({
+ id: idx.toString(),
+ type: ItemType.PICTURE_CHOICE,
+ blockId: block.id,
+ pictureSrc,
+ title: titlesVariableValues?.[idx] ?? '',
+ description: descriptionsVariableValues?.[idx] ?? '',
+ })),
}
}
return deepParseVariables(variables)(