public sealed class UniversalAction : IMessage<UniversalAction>, IEquatable<UniversalAction>, IDeepCloneable<UniversalAction>, IBufferMessage, IMessage
Reference documentation and code samples for the Google.Apps.Script.Type class UniversalAction.
An action that is always available in the add-on toolbar menu regardless of
message context.
[[["Easy to understand","easyToUnderstand","thumb-up"],["Solved my problem","solvedMyProblem","thumb-up"],["Other","otherUp","thumb-up"]],[["Missing the information I need","missingTheInformationINeed","thumb-down"],["Too complicated / too many steps","tooComplicatedTooManySteps","thumb-down"],["Out of date","outOfDate","thumb-down"],["Samples / code issue","samplesCodeIssue","thumb-down"],["Other","otherDown","thumb-down"]],["Last updated 2025-08-07 UTC."],[[["\u003cp\u003eThe \u003ccode\u003eUniversalAction\u003c/code\u003e class, part of the \u003ccode\u003eGoogle.Apps.Script.Type.Gmail\u003c/code\u003e namespace, represents an action available in the add-on toolbar menu in Gmail, regardless of the message context.\u003c/p\u003e\n"],["\u003cp\u003eThis class provides properties such as \u003ccode\u003eOpenLink\u003c/code\u003e, \u003ccode\u003eRunFunction\u003c/code\u003e, and \u003ccode\u003eText\u003c/code\u003e to define the behavior of the action, including opening a link, triggering a function, and displaying user-visible text.\u003c/p\u003e\n"],["\u003cp\u003eThe \u003ccode\u003eUniversalAction\u003c/code\u003e class implements several interfaces, including \u003ccode\u003eIMessage\u003c/code\u003e, \u003ccode\u003eIEquatable\u003c/code\u003e, \u003ccode\u003eIDeepCloneable\u003c/code\u003e, and \u003ccode\u003eIBufferMessage\u003c/code\u003e, and inherits from the \u003ccode\u003eobject\u003c/code\u003e class, providing a variety of functionalities.\u003c/p\u003e\n"],["\u003cp\u003eThere are several versions of the class, ranging from 1.0.0 to 2.3.0 (latest), each with its own documentation page.\u003c/p\u003e\n"],["\u003cp\u003eThe \u003ccode\u003eActionTypeCase\u003c/code\u003e property determines the type of action whether its an open link or a function run, with the \u003ccode\u003eHasOpenLink\u003c/code\u003e and \u003ccode\u003eHasRunFunction\u003c/code\u003e properties respectively telling you if each action is set.\u003c/p\u003e\n"]]],[],null,["# Google.Apps.Script.Type - Class UniversalAction (2.3.0)\n\nVersion latestkeyboard_arrow_down\n\n- [2.3.0 (latest)](/dotnet/docs/reference/Google.Apps.Script.Type/latest/Google.Apps.Script.Type.Gmail.UniversalAction)\n- [2.2.0](/dotnet/docs/reference/Google.Apps.Script.Type/2.2.0/Google.Apps.Script.Type.Gmail.UniversalAction)\n- [2.1.0](/dotnet/docs/reference/Google.Apps.Script.Type/2.1.0/Google.Apps.Script.Type.Gmail.UniversalAction)\n- [2.0.0](/dotnet/docs/reference/Google.Apps.Script.Type/2.0.0/Google.Apps.Script.Type.Gmail.UniversalAction)\n- [1.1.0](/dotnet/docs/reference/Google.Apps.Script.Type/1.1.0/Google.Apps.Script.Type.Gmail.UniversalAction)\n- [1.0.0](/dotnet/docs/reference/Google.Apps.Script.Type/1.0.0/Google.Apps.Script.Type.Gmail.UniversalAction) \n\n public sealed class UniversalAction : IMessage\u003cUniversalAction\u003e, IEquatable\u003cUniversalAction\u003e, IDeepCloneable\u003cUniversalAction\u003e, IBufferMessage, IMessage\n\nReference documentation and code samples for the Google.Apps.Script.Type class UniversalAction.\n\nAn action that is always available in the add-on toolbar menu regardless of\nmessage context. \n\nInheritance\n-----------\n\n[object](https://learn.microsoft.com/dotnet/api/system.object) \\\u003e UniversalAction \n\nImplements\n----------\n\n[IMessage](https://cloud.google.com/dotnet/docs/reference/Google.Protobuf/latest/Google.Protobuf.IMessage-1.html)[UniversalAction](/dotnet/docs/reference/Google.Apps.Script.Type/latest/Google.Apps.Script.Type.Gmail.UniversalAction), [IEquatable](https://learn.microsoft.com/dotnet/api/system.iequatable-1)[UniversalAction](/dotnet/docs/reference/Google.Apps.Script.Type/latest/Google.Apps.Script.Type.Gmail.UniversalAction), [IDeepCloneable](https://cloud.google.com/dotnet/docs/reference/Google.Protobuf/latest/Google.Protobuf.IDeepCloneable-1.html)[UniversalAction](/dotnet/docs/reference/Google.Apps.Script.Type/latest/Google.Apps.Script.Type.Gmail.UniversalAction), [IBufferMessage](https://cloud.google.com/dotnet/docs/reference/Google.Protobuf/latest/Google.Protobuf.IBufferMessage.html), [IMessage](https://cloud.google.com/dotnet/docs/reference/Google.Protobuf/latest/Google.Protobuf.IMessage.html) \n\nInherited Members\n-----------------\n\n[object.GetHashCode()](https://learn.microsoft.com/dotnet/api/system.object.gethashcode) \n[object.GetType()](https://learn.microsoft.com/dotnet/api/system.object.gettype) \n[object.ToString()](https://learn.microsoft.com/dotnet/api/system.object.tostring)\n\nNamespace\n---------\n\n[Google.Apps.Script.Type.Gmail](/dotnet/docs/reference/Google.Apps.Script.Type/latest/Google.Apps.Script.Type.Gmail)\n\nAssembly\n--------\n\nGoogle.Apps.Script.Type.dll\n\nConstructors\n------------\n\n### UniversalAction()\n\n public UniversalAction()\n\n### UniversalAction(UniversalAction)\n\n public UniversalAction(UniversalAction other)\n\nProperties\n----------\n\n### ActionTypeCase\n\n public UniversalAction.ActionTypeOneofCase ActionTypeCase { get; }\n\n### HasOpenLink\n\n public bool HasOpenLink { get; }\n\nGets whether the \"open_link\" field is set\n\n### HasRunFunction\n\n public bool HasRunFunction { get; }\n\nGets whether the \"run_function\" field is set\n\n### OpenLink\n\n public string OpenLink { get; set; }\n\nA link that is opened by Gmail when the user triggers the action.\n\n### RunFunction\n\n public string RunFunction { get; set; }\n\nAn endpoint that is called when the user triggers the\naction. See the [universal actions\nguide](/gmail/add-ons/how-tos/universal-actions) for details.\n\n### Text\n\n public string Text { get; set; }\n\nRequired. User-visible text describing the action, for example, \"Add a new\ncontact.\""]]