Skip to content

Instantly share code, notes, and snippets.

@eliotharper
Created September 24, 2018 02:08
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save eliotharper/329165f6d8489ebf72d39fcfe88fd184 to your computer and use it in GitHub Desktop.
Save eliotharper/329165f6d8489ebf72d39fcfe88fd184 to your computer and use it in GitHub Desktop.
<script runat="server" language="javascript">
Platform.Load("core", "1");
try {
var CheckDE = DataExtension.Init("DE_Name_TO_Check");
var CheckDEStatus = CheckDE.Rows.Lookup(["FieldName"], [Value]);
</script>
%%[SET @DEExists = "true"]%%
<script runat="server" language="javascript">
Platform.Load("core", "1");
}
catch (e) {
</script>
%%[SET @DEExists = "false"]%%
<script runat="server" language="javascript">
Platform.Load("core", "1");
}
</script>
This is to confirm if DE Exists: %%=v(@DEExists)=%%
%%[
if @DEExists == true then
var @rows
set @rows = LookupRows('DE Name', 'Field', 'Value')
endif
]%%
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment